use Flap qw/-m -s -w/;

my %esc = ("\t" => '\\t', "\n" => '\\n', "\r" => '\\r', '"' => '\\"', '\\' => '\\\\');
sub{
    shift;
    my $s;
    join("\t", map{
        !defined($_)  ? '' :
        $_ eq ''      ? '""' :
        /[\t\n\r"\\]/ ? ($s = $_) =~ s/([\t\n\r"\\])/$esc{$1}/eg && $s :
        $_
    }@_);
};
